package com.hxd.otc.module.my.activity;

import android.content.Intent;

import com.hxd.otc.R;
import com.hxd.otc.base.BaseRecyclerActivity;
import com.hxd.otc.module.my.adapter.BankAeraChooseAdapter;
import com.hxd.otc.module.my.bean.BankAeraChooseBean;
import com.hxd.otc.module.my.contract.BankAeraChooseContract;
import com.hxd.otc.module.my.presenter.BankAeraChoosePresenter;

public class BankAeraChooseActivity extends BaseRecyclerActivity<BankAeraChoosePresenter, BankAeraChooseAdapter, BankAeraChooseBean> implements BankAeraChooseContract.IView {

    public static final String RESULT_EXTRA_AERA = "result_aera";

    @Override
    protected BankAeraChooseAdapter createAdapter() {
        return new BankAeraChooseAdapter(this);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_bank_aera_choose;
    }

    @Override
    protected BankAeraChoosePresenter createPresenter() {
        return new BankAeraChoosePresenter(this);
    }

    @Override
    public boolean isEnableLoadMore() {
        return false;
    }

    @Override
    public void onItemClick(int position) {
        Intent intent = new Intent();
        intent.putExtra(RESULT_EXTRA_AERA, mAdapter.getItem(position).getAeraName());
        setResult(RESULT_OK, intent);
        finish();
    }
}
